
const moment = require('moment');

// const date = new Date();
// console.log('date:' + date);

// const time = Math.floor(Date.now() / 1000);
// const date1 = moment(time).format('YYYY-MM-DD HH:mm:ss');
// console.log('date1:' + date1);

// const time = (Date.now() / 1000);
// const timestamp = parseInt(time);
// console.log('time:' + timestamp);
// const time = new Date(1650247200000);
// console.log('time:' + time);

function getData(n){
  n=new Date(n)
  const time =  n.toLocaleDateString().replace(/\//g, "-") + " " + n.toTimeString().substr(0, 8);
  console.log('time:' + time);
}
getData(1650338582000); // time:2022-4-19 11:18:02   time:2022-4-19 11:23:02

// const time = (Date.now());
// console.log('time:' + time);

// var oldTime = (new Date("2022-04-18 10:55:08")).getTime()/1000;
// console.log('old_time:' + oldTime);

// const date = Date.parse(new Date())/1000;
// console.log('date:' + date);

// const now = new Date();
// const  date = now.setTime(now.getTime() + 60 * 24 * 3600 * 1000);
// const month = moment(date).format('YYYY-MM');
// console.log('month:' + month);
// console.log('time:' + date);

// const tables = [];
// tables.push('compression_flow_stats-' + month, 'compression_flow_account_stats-' + month);
// console.log('tables:' + tables);

// const pubmite = moment(now).format('YYYY-MM-DD HH:mm:ss');
// console.log('pubtime:' + pubmite);

const time = Date.parse(new Date())/1000;
console.log('time:' + time);